package com.etc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.etc.dao.JonseekerMapper;
import com.etc.entity.Jonseeker;
import com.etc.entity.LayUiData;
import com.etc.service.JonseeService;
@Service
public class JonseeServiceImp implements JonseeService {
	
	@Autowired
	JonseekerMapper jmapper;
	
	@Override
	public Jonseeker getJon(int userId) {
		// TODO Auto-generated method stub
		return jmapper.getjon(userId);
	}


	@Override
	public List<Jonseeker> queryIsJonName(int start, int limit, String keywords) {
		// TODO Auto-generated method stub
		return jmapper.queryIsJonName(start, limit, keywords);
	}

	@Override
	public int addjon(Jonseeker jonseeker) {
		// TODO Auto-generated method stub
		return jmapper.addjon(jonseeker);
	}

	@Override
	public int deljon(int userId) {
		// TODO Auto-generated method stub
		return jmapper.deljon(userId);
	}

	@Override
	public int updatajon(Jonseeker jon) {
		// TODO Auto-generated method stub
		return jmapper.updatajon(jon);
	}

	@Override
	public LayUiData<Jonseeker> getPage(int page, int limit, String keywords) {
		// TODO Auto-generated method stub
		int start = (page - 1) * limit;
		LayUiData<Jonseeker> laydata = new LayUiData<Jonseeker>();
		laydata.setCode(0);
		laydata.setMsg("");
		List<Jonseeker> list = jmapper.queryIsJonName(start, limit, keywords);
		laydata.setCount(jmapper.getJonseeCount());//后续替换成实际的记录数
		laydata.setData(list);
		return laydata;
	}
	
	
}
